home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part2 / 10061 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.4 KB

  1. Path: rcp6.elan.af.mil!rscernix!danpop
  2. From: danpop@mail.cern.ch (Dan Pop)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: Kind of an annoying question...
  5. Date: 12 Mar 96 12:32:03 GMT
  6. Organization: CERN European Lab for Particle Physics
  7. Message-ID: <danpop.826633923@rscernix>
  8. References: <4hvrio$c4k@lastactionhero.rs.itd.umich.edu> <4i1c48$2si@nuacht.iol.ie>
  9. NNTP-Posting-Host: ues5.cern.ch
  10. X-Newsreader: NN version 6.5.0 #7 (NOV)
  11.  
  12. In <4i1c48$2si@nuacht.iol.ie> Roy Leonard <rleonard@ferrotec.ie> writes:
  13.  
  14.  
  15. >speng@stimpy.us.itd.umich.edu (Steve Palmer Peng) wrote:
  16. >>I'm wondering, just what function in C allows me to enter a character
  17. >>from the keyboard, and it automatically executes the command I designate
  18. >>that character to.  For instance, I have something like,
  19. >>
  20. >>printf("Enter Y or N:");
  21. >>
  22. >>and I want the command after the printf statement to wait for input
  23. >>from the keyboard, but once someone enters a Y or an N, the next line of
  24. >>code is executed, without hitting enter.  Does anyone know how?  It would
  25. >>be greatly appreciated if someone could help me out here...
  26. >
  27. >Sounds like you are looking for getch [get single char]/getche [get
  28. >character and echo to the screen.]
  29.  
  30. And the bad news are that neither getch nor getche are part of the
  31. C library.  For more details, see the FAQ.
  32.  
  33. Dan
  34. --
  35. Dan Pop
  36. CERN, CN Division
  37. Email: danpop@mail.cern.ch 
  38. Mail:  CERN - PPE, Bat. 31 R-004, CH-1211 Geneve 23, Switzerland
  39.